package com.yan.test.test1;

/**
 * @author taoge
 * @Date 2024/8/8 18:49
 * @Description
 */
public class LetterPrinter extends Thread{
    private Printer p;

    public LetterPrinter(Printer p) {
        this.p = p;
    }

    public LetterPrinter(String name, Printer p) {
        super(name);
        this.p = p;
    }

    @Override
    public void run() {
        for (char c = 'A'; c <= 'Z'; c++) {
            p.print(c);
        }
    }
}
